package com.hbl.hhb;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

public class AppRef {
    public static void main(String[] args) throws Exception{
        Class<?> H=Class.forName("com.hbl.hhb.Human");
        Object o=H.newInstance();
        Field name = H.getDeclaredField("name");
        name.setAccessible(true);
        name.set(o,"Timor");

        Method getName = H.getMethod("getName");
        Object result=getName.invoke(o);
        System.out.println(result);
    }
}
